//
// Decompiled by Jadx - 336ms
//
package fg;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import me.plusne.common.Json.JsonPick;
import r.g;

public final class p extends RecyclerView.h<a> {
    public final ArrayList a = new ArrayList();
    public final Activity b;

    public p(Activity activity) {
        this.b = activity;
    }

    public final int getItemCount() {
        return this.a.size();
    }

    public final long getItemId(int i) {
        return ((JsonPick.DataBean) this.a.get(i)).getId();
    }

    public final void onBindViewHolder(RecyclerView.ae aeVar, int i) {
        boolean z;
        String str;
        a aVar = (a) aeVar;
        ArrayList arrayList = this.a;
        JsonPick.DataBean dataBean = (JsonPick.DataBean) arrayList.get(i);
        if (i + 1 == arrayList.size()) {
            z = true;
        } else {
            z = false;
        }
        Activity activity = this.b;
        if (z) {
            aVar.c.setVisibility(View.GONE);
        }
        TextView textView = aVar.d;
        textView.setText("兑换奖品");
        StringBuilder sb = new StringBuilder();
        sb.append(aVar.getAbsoluteAdapterPosition() + 1);
        sb.append(". ");
        sb.append(dataBean.getApp());
        StringBuilder sb2 = new StringBuilder(" (");
        if (dataBean.getData() == 0) {
            str = "永久版";
        } else {
            str = dataBean.getData() + "天";
        }
        sb2.append(str);
        sb2.append(")");
        sb.append(g.l(sb2.toString(), "#F7941D"));
        String sb3 = sb.toString();
        TextView textView2 = aVar.a;
        textView2.setText(g.w(textView2, sb3));
        String str2 = "中奖时间:" + dataBean.getTime();
        TextView textView3 = aVar.b;
        textView3.setText(g.w(textView3, str2));
        View.OnClickListener mVar = new m(aVar, activity, dataBean, this, 0);
        ((RecyclerView.ae) aVar).itemView.setOnClickListener(mVar);
        textView.setOnClickListener(mVar);
        textView2.setOnClickListener(mVar);
        textView3.setOnClickListener(mVar);
    }

    public final RecyclerView.ae onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new a(LayoutInflater.from(viewGroup.getContext()).inflate(-2113142716, viewGroup, false));
    }
}
